package io.gitee.yth.design.pattern.test.core.pattern.behavioral.visitor.element;

import io.gitee.yth.design.pattern.test.core.pattern.behavioral.visitor.visitor.Visitor;

import java.util.Collection;

/**
 * @author yth
 * @since 2023-04-29-16:31
 */
public class CollectionElement implements Visitable {

    private final Collection<Visitable> collection;

    public CollectionElement(Collection<Visitable> collection) {
        this.collection = collection;
    }

    public Collection<Visitable> getCollection() {
        return collection;
    }

    @Override
    public void accept(Visitor v) {
        v.visitCollection(this);
    }
}
